package com.jxstyle.core.exception;

/**
 * @Description 所有业务异常的枚举
 * @author fengshuonan
 * @date 2016年11月12日 下午5:04:51
 */
public enum BizExceptionEnum {


	/**
	 * 文件上传
	 */
	FILE_NOT_FOUND(400,"FILE_NOT_FOUND!"),
	NO_AUTH(403,"无访问权限!"),
	UPLOAD_ERROR(500,"上传图片出错"),


	PARAMETER_ERROR(1000,"参数错误"),
	LOGIN_PASSWORD_ERROR(1001,"账号或密码错误"),
	LOGIN_STATUS_ERROR(1002,"账号以禁用"),

	REGISTER_HAVE_ERROR(2000,"账号已注册"),
	REGISTER_PARAMETER_ERROR(2001,"注册参数不能为空"),
	REGISTER_VERIFY_CODE_ERROR(2002,"注册验证码错误"),

	/**
	 * 错误的请求
	 */
	REQUEST_NULL(400, "请求有错误"),
	SESSION_TIMEOUT(400, "会话超时"),
	SERVER_ERROR(500, "服务器异常"),
	DATA_REPEAT_ERROR(500, "数据重复");

	BizExceptionEnum(int code, String message) {
		this.friendlyCode = code;
		this.friendlyMsg = message;
	}
	
	BizExceptionEnum(int code, String message,String urlPath) {
		this.friendlyCode = code;
		this.friendlyMsg = message;
		this.urlPath = urlPath;
	}

	private int friendlyCode;

	private String friendlyMsg;
	
	private String urlPath;

	public int getCode() {
		return friendlyCode;
	}

	public void setCode(int code) {
		this.friendlyCode = code;
	}

	public String getMessage() {
		return friendlyMsg;
	}

	public void setMessage(String message) {
		this.friendlyMsg = message;
	}

	public String getUrlPath() {
		return urlPath;
	}

	public void setUrlPath(String urlPath) {
		this.urlPath = urlPath;
	}

}
